<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>tango.math.ErrorFunction</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="css/ie56hack.css"><![endif]-->
<script language="JavaScript" src="js/util.js" type="text/javascript"></script>
<script language="JavaScript" src="js/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="js/explorer.js" type="text/javascript"></script>
<script>
function anchorFromTitle(title, path, ext) {
  var url = path + title + "." + ext;
  document.write("<a href='" + url + "'>" + title + "</a>");
  }
</script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("tango.math.ErrorFunction");</script>
        <table class="content">
                <tr><td id="docbody"><h1><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/ErrorFunction.d?rev=3791">tango.math.ErrorFunction</a></h1>
                
<font color="black">Error Functions and Normal Distribution.</font><br><br>
<b>License:</b><br>
BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a><br><br>
<b>Authors:</b><br>
Stephen L. Moshier, ported to D by Don Clugston<br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/ErrorFunction.d?rev=3791#L100">erfc</a></span>
<script>explorer.outline.addDecl('erfc');</script>(real <span class="funcparam">a</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Complementary error function</font><br><br>
<font color="black">erfc&#40;x&#41; = 1 - erf&#40;x&#41;, and has high relative accuracy for
 values of x far from zero. &#40;For values near zero, use erf&#40;x&#41;&#41;.<br><br>  1 - erf&#40;x&#41; =  2/ &#40;&pi;&#41;
     &#8747; exp&#40; - t<sup>2</sup>&#41; dt<br><br>
 For small x, erfc&#40;x&#41; = 1 - erf&#40;x&#41;; otherwise rational
 approximations are computed.<br><br> A special function expx2&#40;x&#41; is used to suppress error amplification
 in computing exp&#40;-x^2&#41;.
 </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>real <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/math/ErrorFunction.d?rev=3791#L186">erf</a></span>
<script>explorer.outline.addDecl('erf');</script>(real <span class="funcparam">x</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Error function</font><br><br>
<font color="black">The integral is<br><br>  erf&#40;x&#41; =  2/ &#40;&pi;&#41;
     &#8747; exp&#40; - t<sup>2</sup>&#41; dt<br><br> The magnitude of x is limited to about 106.56 for IEEE 80-bit
 arithmetic; 1 or -1 is returned outside this range.<br><br> For 0 &lt;= |x| &lt; 1, a rational polynomials are used; otherwise
 erf&#40;x&#41; = 1 - erfc&#40;x&#41;.<br><br> </font><br><br>
<b>ACCURACY:</b><br>Relative error:
 arithmetic   domain     # trials      peak         rms
    IEEE      0,1         50000       2.0e-19     5.7e-20<br><br></dd></dl></td></tr>
                <tr><td id="docfooter">
                        Copyright (C) 1984, 1995, 2000 Stephen L. Moshier
   Code taken from the Cephes Math Library Release 2.3:  January, 1995 :: page rendered by CandyDoc. Generated by <a href="http://code.google.com/p/dil">dil</a> on Sat Aug  2 16:08:34 2008.
                </td></tr>
        </table>
</div>
<script></script>
</body></html>